← Back to issue list

Snap names regexes are inconsistent or too permissive

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1763048
Type
issue
State
open
Author
~adam-collard
Labels
Created
2018-04-11 14:27:38.301994+00:00
Updated
2019-10-29 21:20:14.707166+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

Currently, the store restricts snap names to comply with: package_name_re_str = r'^[a-z0-9-]*[a-z][a-z0-9-]*$' The regex above allows snap names of one single char (even '-') being registered. The reviewer tools allow for: r'^[a-z0-9-]*[a-z][a-z0-9-]*$' plus some extra checks (see check_name method in https://bazaar.launchpad.net/~store-reviewers/click-reviewers-tools/trunk/view/head:/clickreviews/sr_lint.py#L173) Snapd allow for: the same regex than the store plus some extra checks, see https://github.com/snapcore/snapd/blob/master/snap/validate.go#L40 Snapcraft does not seem to enforce any regex (or I couldn't find one) -- I think we can leave this as is. We want to ensure snapd, c-r-t and the store are consistent and do not allow one-char snap names being registered, nor having - at the beginning or end of a name, nor -- in it (similar to what snapd does but also restricting the min length).

Evaluation history

No evaluation history available.